package com.bkgy.controller.tbCgl1870SteelgradeSpe2.controller;

import com.bkgy.controller.tbCgl1870SteelgradeSpe2.entity.TbCgl1870SteelgradeSpe2;
import com.bkgy.controller.tbCgl1870SteelgradeSpe2.service.ITbCgl1870SteelgradeSpe2Service;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Tag(name = "1870钢种配置表")
@Controller
@RequestMapping("/tbCgl1870SteelgradeSpe2")
public class TbCgl1870SteelgradeSpe2Controller {

	@Autowired
	private ITbCgl1870SteelgradeSpe2Service service;

	@ResponseBody
	@Operation(summary = "新增")
	@PostMapping("/tbCgl1870SteelgradeSpe2add")
	public ResultData<String> savetbCgl1870SteelgradeSpe2 (@RequestBody TbCgl1870SteelgradeSpe2 obj){
		obj.setCreateTime(new Date());
		return service.saveTbCgl1870SteelgradeSpe2(obj);
	}
	@ResponseBody
	@Operation(summary = "修改")
	@PostMapping("/tbCgl1870SteelgradeSpe2update")
	public ResultData<String> updatetbCgl1870SteelgradeSpe2 (@RequestBody TbCgl1870SteelgradeSpe2 obj){
		return service.updateTbCgl1870SteelgradeSpe2(obj);
	}
	@ResponseBody
	@Operation(summary = "删除")
	@PostMapping("/tbCgl1870SteelgradeSpe2delete")
	public ResultData<String> deletetbCgl1870SteelgradeSpe2 (@RequestBody TbCgl1870SteelgradeSpe2 obj){
		return service.deleteTbCgl1870SteelgradeSpe2(obj);
	}
	@ResponseBody
	@Operation(summary = "分页查询")
	@PostMapping("/tbCgl1870SteelgradeSpe2Page")
	public ResultData<String> selectPage (@RequestBody TbCgl1870SteelgradeSpe2 obj){
		return service.selectPage(obj);
	}
}
